package com.js.common.constant;

import com.js.domian.model.bot.ApiResult;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.java_websocket.client.WebSocketClient;

import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;

public class BotConst {
    public static final Map<String, CompletableFuture<ApiResult>> completableFutureMap = new ConcurrentHashMap<>();
    public static final Map<Long, WebSocketClient> webSocketClientMap = new ConcurrentHashMap<>();

    @AllArgsConstructor
    public enum BOT_RESPONSE_TYPE {

        TEXT("1"), WEB_IMAGE("2"), RANDOM_IMAGE("3");

        @Getter
        private String value;

        public static BOT_RESPONSE_TYPE getByValue(String value){
            for (BOT_RESPONSE_TYPE type : BOT_RESPONSE_TYPE.values()){
                if(type.getValue().equals(value)){
                    return type;
                }
            }
            return null;
        }
    }
}
